<?php
/**
 * @package Green Realty component
 * @copyright (C) 2012 Greenkey studio. All rights reserved
 * @license GNU/GPL Version 2 - http://www.gnu.org/licenses/gpl-2.0.html
 * @author Greenkey studio
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_grealty'))
{
	return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}

// require helper file
JLoader::register('GRealtyHelper', dirname(__FILE__) . DS . 'helpers' . DS . 'grealty.php');

// import joomla controller library
jimport('joomla.application.component.controller');

// Get an instance of the controller prefixed by GRealty
$controller = JController::getInstance('GRealty');

// Perform the Request task and run to execute them
$input = JFactory::getApplication()->input;
$controller->execute($input->getCmd('task'));
// As a same, we can use this in one line
//$controller->execute(JRequest::getCmd('task'));

// Redirect if set by the controller
$controller->redirect();

?>